package com.prs.crm.dao.crm.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Property;

import com.prs.crm.dao.crm.EquipmentDao;
import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.domain.crm.Equipment;
import com.prs.crm.domain.crm.Fault;

public class EquipmentDaoImpl extends BaseDaoImpl<Equipment> implements EquipmentDao{

	@Override
	public List<Equipment> getEquipmentByFault(Fault fault) {
		Criteria criteria = this.getSession().createCriteria(Equipment.class);
		criteria.add(Property.forName("fault").eq(fault));
		return criteria.list();
	}

}
